//app.js
var http = require('utils/config.js'); //接口配置
import config from './utils/http-config'
var userInfo = {};
App({
  onLaunch: function () {
    // var logs = wx.getStorageSync('logs') || []
    // logs.unshift(Date.now())
    // wx.setStorageSync('logs', logs)

    // 登录
    wx.login({
      success: res => {
        wx.request({
          url: `${config.api_baseUrl}/home/pay/getSessionKey`,
          data: {
            code: res.code,
            appid: 'wx12aa072b256c9761',
            secret: '444f48e2b5591487567e7f8ed57c8c2a',
          },
          success:function(suc){
            wx.setStorage({
              key: 'openid',
              data: suc.data.data.openid,
            })
          }
        })
      }
    })
  },
  globalData: {
    userInfo: null,
    host: 'https://www.zhiweihome.com/zhixiu/drumhome/'
  },
  func: {
    req: http.req
  },
})